//
//  ViewController.m
//  ExampleDemo
//
//  Created by     on 16/4/5.
//
//

#import "ViewController.h"
#import "UIScrollView+TJJRefresh.h"
#import "TJJRefreshNormalHeader.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupView];
}

- (void)setupView {
    UIWebView *web = [[UIWebView alloc] initWithFrame:self.view.bounds];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"www.baidu.com"]];
    [web loadRequest:request];
    [self.view addSubview:web];
    web.scrollView.tjj_header = [TJJRefreshNormalHeader headerWithRefreshingBlock:^{
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [web.scrollView.tjj_header endRefreshing];
        });
    }];
}

@end
